//
//  VoicePlayView.m
//  TravelToHelp
//
//  Created by lanou3g on 15/11/5.
//  Copyright © 2015年 冯贵宾. All rights reserved.
//

#import "VoicePlayView.h"

@implementation VoicePlayView

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        [self addSubviews];
    }
    return self;
}

- (void)addSubviews
{
    self.musicIMGView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.width, self.width / 2)];
    self.musicIMGView.backgroundColor = [UIColor orangeColor];
    [self addSubview:self.musicIMGView];
    
    
    self.lyricTabView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, self.width, self.width / 2)];
    self.lyricTabView.backgroundColor = [UIColor blueColor];
    [self addSubview:self.lyricTabView];
    self.lyricTabView.dataSource = self;
    self.lyricTabView.delegate = self;
    self.lyricTabView.separatorStyle = UITableViewCellSelectionStyleNone;

    
    self.progressSlider = [[UISlider alloc] initWithFrame:CGRectMake(50, self.width / 2 + 20, kScreenWidth - 100, 0)];
    [self addSubview:self.progressSlider];

    
    
    self.lastBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    self.lastBtn.frame = CGRectMake(kScreenWidth / 4, kScreenWidth - 50, 40, 40);
    self.lastBtn.backgroundColor = [UIColor grayColor];
    self.lastBtn.center = CGPointMake(kScreenWidth / 6, kScreenWidth - 140);
    [self addSubview:self.lastBtn];
    
    
    
    self.playBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    self.playBtn.frame = CGRectMake(kScreenWidth / 4, kScreenWidth - 50, 40, 40);
    self.playBtn.backgroundColor = [UIColor grayColor];
    self.playBtn.center = CGPointMake(kScreenWidth / 2, kScreenWidth - 140);
    [self addSubview:self.playBtn];
    
    
    
    self.nextBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    self.nextBtn.frame = CGRectMake(kScreenWidth / 4 * 3, kScreenWidth - 50, 40, 40);
    self.nextBtn.backgroundColor = [UIColor grayColor];
    self.nextBtn.center = CGPointMake(kScreenWidth / 6 * 5, kScreenWidth - 140);
    [self addSubview:self.nextBtn];
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 20;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *lyric = @"lyric";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:lyric];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:lyric];
    }
    cell.alpha = 0.3;
    return cell;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
